package org.example.boot.mybatis.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.example.boot.mybatis.bean.Stu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.junit.jupiter.api.Test;

import java.util.List;

@Mapper
public interface StuMapper {
    @Select("select * from stu1 where zt=1")
    List<Stu> find();

    @Insert("insert into stu1 values (null,#{name},#{sex},#{age},#{tel},#{scores},#{school},1)")
    boolean save(Stu stu);

    @Update("update stu1 set name=#{name} where id=#{id}")
    boolean update(Stu stu);

    @Update("update stu1 set zt=0 where id=#{id}")
    boolean delete(int id);
}
